import { Injectable } from '@angular/core';
import {ApiService, ServerConfigService} from '../../../ng-tools';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class TicketService extends ApiService {

    constructor(http: HttpClient, serverConfig: ServerConfigService) {
        super(http, serverConfig);
        this.baseUrl = '';
        this.urls = {
            paginationUrl: '',
            login: '/sysManager/login',
            logout: '/sysManager/logoff',
            getPlatAnnoucement: '/basicInfo/getPlatAnnoucement',
            updatePlatAnnoucement: '/basicInfo/updatePlatAnnoucement',
            customList: '/customService/list',
            addCus: '/customService/addCus',
            delCus: '/customService/delCus',
            getAccountInfo: '/sysManager/getAccountInfo',
            saveAccountInfo: '/sysManager/saveAccountInfo',
            getUsers: '/userInfo/getUsers',
            etOrCancelAgent: '/userInfo/setOrCancelAgent',
            getOrderList: '/accountOrder/getOrderList',
            dealOrder: '/accountOrder/dealOrder',
            resetPwd: '/userInfo/resetPwd',
            getInitData: '/sysManager/getInitData',
            updateSysConfig: '/sysManager/updateSysConfig',
            getUrl: '/sysManager/getUrl',
            updateUrl: '/sysManager/updateUrl',
            tjResume: '/sysManager/tjResume',
            freezeUser: '/userInfo/freezeUser',
            getAllRobots: '/sysManager/getAllRobots',
            userAvatarDownloader: '/UserAvatarDownloader',
            GroupAvatarUploader: '/GroupAvatarUploader',
            GroupAvatarDownloader: '/GroupAvatarDownloader',
            UserAvatarUploader: '/UserAvatarUploader',
            updateRobotInfo: '/sysManager/updateRobotInfo',
            generateRobots: '/sysManager/generateRobots',
            getRobotsGroup: '/sysManager/getRobotsGroups',
            getRobotsByGroupId: '/sysManager/getRobotsByGroupId',
            delRobot: '/sysManager/delRobot',
            addRobotToRobotGroup: '/sysManager/addRobotToRobotGroup',
            delRobotFromRobotGroup: '/sysManager/delRobotFromRobotGroup',
            createRobotGroup: '/sysManager/createRobotGroup',
            getGameGroup: '/sysManager/getGameGroup',
            createGameGroup: '/sysManager/createGameGroup',
            freezeGroup: '/sysManager/freezeGroup',
            updateMasterFlPerc: '/sysManager/updateMasterFlPerc',
            getGroupMoneyInfo: '/sysManager/getGroupMoneyInfo',
            getUserOrderInfo: '/sysManager/getUserOrderInfo',
            getPlatAccountInfo: '/sysManager/getPlatAccountInfo',
            getAccounts: '/sysManager/getAccounts',
            saveAccountInfos: '/sysManager/saveAccountInfo',
            delAccountInfo: '/sysManager/delAccountInfo',
            AccountInfoUploader: '/AccountInfoUploader',
            AccountInfoDownloader: '/AccountInfoDownloader'

        };
    }

  login(data): Observable<any> {
    return this.post(this.urls.login, data, {headers: {'auth': 'false'}, observe: 'response'});
  }
}
